<style>
	#TableOfMedia {
		width:70%;
	}
	#TableOfMedia th {
		font-size:11px;
		text-align:left;
		border-bottom: 1px solid #003a63;
	}
	#TableOfMedia td {
		font-size:11px;
		text-align:left;
	}
	#TableOfMedia td.odd {
		background-color:#eaefee;
	}
	#TableOfMedia a {
		font-size:11px;
		text-align:left;
	}	
</style>

<h5>Media Collections</h5>
<table id="TableOfMedia" cellspacing="0" cellpadding="5">
<tr><th>Name</th><th>Type</th><th>&nbsp;</th></tr>
<?php 
global $DB;
$query = "select mc.id, mc.name,mct.name as type_name from media_collections mc join media_coll_types mct on mc.coll_type_id = mct.id order by mc.name";

$DB->query($query);
for($i=0;$row = $DB->fetch_row();$i++) {
	($i%2==0)?$idText = 'class="odd"':$idText = '';
	print '<tr>';
	print '<td '.$idText.'>'.$row['name'].'</td>';
	print '<td '.$idText.'>'. $row['type_name'] . '</td>';
	print '<td '.$idText.'><a href="index.php?action=media&id='.$row['id'].'">[list]</a>';
	print '</td>';
	print '</tr>';
}	
?>
</table>